<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>核酸检测页面</title>
    <script src="/jQuery.js"></script>
    <style>
        * {
            text-align: center;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <h2>核酸检测系统</h2>
    <form th:action="@{/MedicalAssay}" method="get">
        <select name="hospitalId">
            <option value="">--请选择--</option>
            <option th:each="b:${hostList}" th:value="${b.id}" th:text="${b.name}" th:selected="${b.id}==${hospitalId}"></option>
        </select>
        <input type="submit" value="查询">
    </form>
<form th:action="@{/toAdd}" method="get" style="margin-left: 630px">
    <input type="submit" value="添加">
</form>
<table border="1" style="margin: 0 auto">
    <tr>
        <th>被检测人</th>
        <th>被检测人手机号</th>
        <th>被检测人身份证号</th>
        <th>检测机构</th>
        <th>检测日期</th>
        <th>检测结果</th>
        <th>操作</th>
    </tr>
    <tr th:each="b: ${listMedical}">
        <td th:text="${b.assayUser}"></td>
        <td th:text="${b.phone}"></td>
        <td th:text="${b.cardNum}"></td>
        <td th:text="${b.hospital.name}"></td>
        <td th:text="${#dates.format(b.assayTime,'yyyy-MM-dd')}"></td>
        <td th:text="${b.assayResult==0 ? '检测中' : '确诊'}"></td>
        <td>
            <a th:href="@{/updateMedical(id=${b.id})}" onclick="let at = (confirm('请确认该检测者是否确诊?'));return at">确诊</a>
        </td>
    </tr>
</table>
</body>
</html>
<script>
    $("tr:even").css("background-color","darkgray")
</script>